package com.example.timetask;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author jie
 * @date 2019/3/25 0025 -13:35
 */
@Component
public class MySchedule {

   /* @Scheduled(fixedDelay = 1000)
    public void fixedDelay(){
        System.out.println("fixedDelay:" + new Date());
    }

    @Scheduled(fixedDelay = 1000)
    public void fixedRate(){
        System.out.println("=============================");
        System.out.println("fixedDelay:" + new Date());
    }

    @Scheduled(initialDelay = 1000,fixedRate = 2000)
    public void initialDelay(){
        System.out.println("=============================");
        System.out.println("initialDelay"+new Date());
    }

    @Scheduled(cron = "0 * * * * ?")
    public void cron() {
        System.out.println("=============================");
        System.out.println("cron:"+new Date());
    }*/
}
